font chooser: Move buttons to template
authorMatthias Clasen <mclasen@redhat.com>
Wed, 9 Jul 2014 23:43:20 +0000 (19:43 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 9 Jul 2014 23:48:22 +0000 (19:48 -0400)
Use the new builder dialog action support.

gtk/gtkfontchooserdialog.c
gtk/resources/ui/gtkfontchooserdialog.ui
gtk/resources/ui/gtkfontchooserdialog.ui.h

index 2b826407ad4c7e23d176d5fd200dcc92d6fa3373..1931a866fbe7ca0caa2ddf5e39f3fdd18f4cd0bf 100644 (file)
@@ -151,11 +151,7 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
 
   gtk_widget_init_template (GTK_WIDGET (fontchooserdiag));
   gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (fontchooserdiag));
-  gtk_dialog_add_buttons (GTK_DIALOG (fontchooserdiag),
-                          _("_Cancel"), GTK_RESPONSE_CANCEL,
-                          _("_Select"), GTK_RESPONSE_OK,
-                          NULL);
-  gtk_dialog_set_default_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
+
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontchooserdiag),
                                            GTK_RESPONSE_OK,
index a1dea23ca45c2758105a306a84963bc3ba44862c..61e6ea54b1052d227eb6fe5deea32dd8363544a1 100644 (file)
         </child>
       </object>
     </child>
+    <child type="action">
+      <object class="GtkButton" id="cancel_button">
+        <property name="visible">True</property>
+        <property name="use_underline">True</property>
+        <property name="label" translatable="yes">_Cancel</property>
+      </object>
+    </child>
+    <child type="action">
+      <object class="GtkButton" id="ok_button">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">_Select</property>
+        <property name="use_underline">True</property>
+        <property name="can_default">True</property>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="cancel">cancel_button</action-widget>
+      <action-widget response="ok" default="true">ok_button</action-widget>
+    </action-widgets>
   </template>
 </interface>
index 3078a6db106e31239f11e87d52c8f3ddae8d3b54..2996d844a457949589b324dad646fde88d8cc93a 100644 (file)
@@ -1 +1,3 @@
 N_("Select Font");
+N_("_Cancel");
+N_("_Select");